class_name Jian extends Node2D

var cha = 23	# 键与棋子之间留点距离
var narrow = 0.05	#缩小比例

func init(pos:Vector2, color:Color, length:float, angle:float):
	position = pos
	rotation = angle
	$"背景".position.x = cha * (1/narrow)
	$"背景".size.x = (length - cha * 2) * (1/narrow)
	$"背景/箭头".self_modulate = color
	scale = Vector2(narrow,narrow)
